/**
 * 
 */
package es.udc.emarketapp.http.controller.actions.shopping;

import es.udc.emarketapp.emarket.model.client.vo.ClientVO;
import es.udc.emarketapp.emarket.model.order.vo.OrderVO;
import es.udc.emarketapp.emarket.model.orderDetails.vo.OrderDetailsVO;
import es.udc.emarketapp.emarket.model.orderLine.vo.OrderLineVO;
import es.udc.emarketapp.emarket.model.product.vo.ProductVO;
import es.udc.emarketapp.emarket.model.productFacade.ProductFacade;
import es.udc.emarketapp.emarket.model.shoppingFacade.vo.OrderCartVO;
import es.udc.emarketapp.emarket.model.shoppingFacade.vo.OrderLineCartVO;
import es.udc.emarketapp.http.controller.session.SessionManager;
import es.udc.emarketapp.http.controller.session.shoppingManager.ShoppingManager;
import es.udc.emarketapp.http.view.actionForms.BuyProductForm;
import es.udc.emarketapp.http.view.actionForms.ModifyCartForm;
import es.udc.fbellas.j2ee.util.exceptions.InstanceNotFoundException;
import es.udc.fbellas.j2ee.util.exceptions.InternalErrorException;
import es.udc.fbellas.j2ee.util.struts.action.DefaultAction;
import java.io.IOException;
import java.util.Collection;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;
import org.apache.struts.action.ActionMessages;

public class RemoveCartItemAction extends DefaultAction {

    public ActionForward doExecute(ActionMapping mapping, ActionForm form,
            HttpServletRequest request, HttpServletResponse response)
            throws IOException, ServletException, InternalErrorException {


        ActionMessages errors = new ActionMessages();

        ModifyCartForm modifyCartForm = (ModifyCartForm) form;

        String seller = modifyCartForm.getIdSeller();
        Long nLine = modifyCartForm.getnLine();


        ShoppingManager.deleteOrderLine(seller, nLine, request);

    

        //OrderCartVO order = ShoppingManager.getOrder(idSeller, request);

 
        return mapping.findForward("success");

    }
}
